<div class="main-password">
  <div class="main-title">
    <h2>修改密码</h2>
  </div>
  <div class="main-section">
    <form method="post" class="j-pwd-form">
      <ul class="form-group">
        <li>
          <label>输入新密码</label>
          <input class="form-control j-password1" type="password" maxlength="200" name="password" style="width:265px;" required>
        </li>
        <li>
          <label>确认密码</label>
          <input class="form-control j-password2" type="password" maxlength="200" style="width:265px;" required>
        </li>
        <li><input type="submit" class="btn btn-primary" value="确认修改"></li>
      </ul>
    </form>
  </div>
</div>
<script>
  $('.j-pwd-form').submit(function (e) {
    if ($('.j-password1').val() !== $('.j-password2').val()) {
      alert('两次输入的密码不一致！');
      e.stopImmediatePropagation();
      e.preventDefault();
    }
  });
  main.ajaxForm('.j-pwd-form');
</script>